package cn.pb.connectionmysql.controller;

import cn.pb.connectionmysql.entity.Userinfo;
import cn.pb.connectionmysql.service.UserinfoService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * (Userinfo)表控制层
 *
 * @author makejava
 * @since 2020-07-03 12:37:06
 */
@RestController
@RequestMapping("userinfo")
public class UserinfoController {
    /**
     * 服务对象
     */
    @Resource
    private UserinfoService userinfoService;

    /**
     * 通过主键查询单条数据
     *
     * @param id 主键
     * @return 单条数据
     */
    @GetMapping("selectOne")
    public Userinfo selectOne(Integer id) {
        return this.userinfoService.queryById(id);
    }

    /**
     * 通过账号密码检测能否登录
     * @param userName 账号
     * @param userPassword 密码
     * @return 登录页面
     */
    public String selectUserByuserNameAnduserPwd(String userName, String userPassword){

        return this.selectUserByuserNameAnduserPwd("userName","userPassword");

    }
}